#include "DeclareFile.h"

//渲染游戏背景
void UpdateBg() {

    LPCTSTR text = _T("暂停");

    //获取文本宽度和长度
    int text_width = textwidth(text);
    int text_height = textheight(text);
    setbkmode(TRANSPARENT);
    settextstyle(30, 0, "宋体");

    int text_x = 680 + (780 - 680 - text_width) / 2;
    int text_y = 20 + (60 - 20 - text_height) / 2;
    settextcolor(BLACK);
    LOGFONT f;
    gettextstyle(&f);          // 获取当前字体设置
    f.lfWeight = FW_BOLD;      // 设置字体加粗
    settextstyle(&f);

    setfillcolor(RED);
    fillrectangle(680, 20, 780, 60);
    outtextxy(text_x, text_y, text);

    //printf("----\n");

}